package cn.cloud9.jax_ws.server.intf;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.soap.SOAPBinding;

/**
 * @author OnCloud9
 * @description
 * @project WebService
 * @date 2022年04月23日 11:10
 *
 * 标注此接口是Web服务接口
 */
@WebService(
        targetNamespace = "http://service.cn.cloud9",
        name = "WeatherWS-Soap",
        portName = "WeatherWS-Soap-Port",
        serviceName = "WeatherWS"
)
@BindingType(SOAPBinding.SOAP12HTTP_BINDING) // 发布 SOAP1。2接口
public class WeatherInterfaceImpl implements WeatherInterface{

    @WebMethod(
            operationName = "getWeather",
            exclude = false
    )
    @Override
    public @WebResult(name = "result") String queryWeather(@WebParam(name = "cityName") String cityName) {
        System.out.println("打印城市名称：" + cityName);
        return cityName + " 天气：晴朗";
    }
}
